<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2017/9/6
 * Time: 9:54
 */

namespace Admin\Controller;

use Think\Controller;
class CommonController extends Controller
{
    public function _initialize(){
        $auth = new \Think\Auth();
        $user_id = $_SESSION['admin']['user_id'];
        //auth 用户权限检测
//        if(!$auth->check(MODULE_NAME.'-'.ACTION_NAME,$user_id)){
//            $this->error('你没有权限');
//        }

        //后台管理侧边栏
        $model = D('menu'); //new \Admin\Model\MenuModel();
        $left = $model->getMenuAll();
        $this->assign('left', $left);
    }

}